package com.baitiaojun.api.domain.video;

import com.baitiaojun.api.domain.user.UserInfo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import lombok.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * @类名 VideoChildCollection
 * @描述 TODO
 * @作者 白条君
 * @创建日期 2022/12/27 00:49
 * @版本 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ApiModel("视频二级评论")
@Document(indexName = "video_child_comment")
public class VideoChildComment {

    @JsonSerialize(using = ToStringSerializer.class)
    @Id
    private Long id;

    @JsonSerialize(using = ToStringSerializer.class)
    @Field(type = FieldType.Long)
    private Long videoid;

    @JsonSerialize(using = ToStringSerializer.class)
    @Field(type = FieldType.Long)
    private Long userid;

    @JsonSerialize(using = ToStringSerializer.class)
    @Field(type = FieldType.Long)
    private Long replyuserid;

    @JsonSerialize(using = ToStringSerializer.class)
    @Field(type = FieldType.Long)
    private Long rootid;

    @Field(type = FieldType.Date, index = false)
    private Date createtime;

    @Field(type = FieldType.Date, index = false)
    private Date updatetime;

    @Field(type = FieldType.Text, index = false)
    private String comment;

    @Field(type = FieldType.Object, index = false)
    private UserInfo userInfo;

    @Field(type = FieldType.Object, index = false)
    private UserInfo replyUserInfo;

    private String rootComment;
}
